home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 September / 1984-09.d64 / disk tricks 2 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  851b  |  19 lines

  1. 100 sys65517:ifpeek(781)=22thenmt$="":tm$="":goto500
  2. 110 mt$="":tm$=""
  3. 500 print"[147]"mt$"      warning":print" this program will "
  4. 501 print" change the disk id.":print" please make sure that"
  5. 502 printtm$" the gazette disk[146] is":print" is not in the drive."
  6. 1000 fori=1to7000:next
  7. 1999 rem end: rem program 2: change disk id
  8. 2000 input "[147]new disk id";id$
  9. 2010 if len(id$) <> 2 then 2000: rem reject improper length id
  10. 2020 open 15,8,15,"i": rem open disk command channel
  11. 2030 open 8,8,8,"#": rem open direct access channel
  12. 2040 print#15, "u1:"8;0;18;0: rem read track 18, sector 0 into channel 8 buffer
  13. 2050 print#15, "b-p:"8;162: rem move buffer-pointer to first byte of disk id
  14. 2060 print#8, id$;: rem put new id in channel 8 buffer, replacing old id
  15. 2070 print#15, "u2:"8;0;18;0: rem store buffer to disk
  16. 2080 close 8: rem close direct access channel
  17. 2090 close15: rem close command channel
  18. 2100 rem goto 100: rem restart display t&s program if appended
  19.